package com.lsyw.intergrate.mapper;

import com.lsyw.intergrate.entity.JcMassifFactorValue;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 监测数据表 Mapper 接口
 * </p>
 *
 * @author 刘磊
 * @since 2023-12-19
 */
@Mapper
public interface JcMassifFactorValueMapper extends BaseMapper<JcMassifFactorValue> {

    List<Map<String, Object>> getMaxDateList(Map<String, Object> condition);

    List<Map<String, Object>> getAvgInfo(Map<String, Object> condition);

   Map<String, Object> getAvgVoiceInfo(Map<String, Object> condition);

    List<Map<String, Object>> getDayInfo(Map<String, Object> condition);

    List<JcMassifFactorValue> getList(Map<String, Object> condition);


    @Select("select DISTINCT(fv.device_no) from jc_massif_factor_value fv LEFT JOIN jc_massif_factor_value_log fvl ON fv.jc_massif_factor_value_log = fvl.id where fvl.massif_id=#{massifId} and fv.gmt_create between #{startTime} and #{endTime}; ")
    List<String> getDeviceNoList(@Param("massifId") String massifId,@Param("startTime") Date startTime,@Param("endTime") Date endTime);
}
